package com.hydra.footstones;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.hydra.baseui.activity.BaseActivity;
import com.hydra.framework.router.JRouter;

/**
 * Created by Hydra on 2017/8/3.
 *
 * 用一个空activity做启动activity，可以处理一些intent或者事件比较灵活
 * 纯做一个事件转发和跳转的作用，不展示，可以避免MainActivity中做太多事
 */
public class InitActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        goMain();
    }

    private void goMain() {
        JRouter.build("footstones://main").from(this).
                withIntentFlag(Intent.FLAG_ACTIVITY_CLEAR_TOP).
                withIntentFlag(Intent.FLAG_ACTIVITY_NEW_TASK).
                finish(true).anim(0, 0).go();
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(0, 0);
    }

    @Override
    public void onBackPressed() {
        //do nothing
    }
}
